﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BindCodes
{
    public partial class FrmProcessBar : Form
    {
        BackgroundWorker backgroundWorker1;

        public FrmProcessBar(BackgroundWorker backgroundWorker1)
        {
            InitializeComponent();

            this.backgroundWorker1 = backgroundWorker1;

            this.backgroundWorker1.ProgressChanged += new ProgressChangedEventHandler(backgroundWorker1_ProgressChanged);
        }

        private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            this.pbMain.Value = e.ProgressPercentage;

            try
            {
                this.txtMsg.AppendText(e.UserState.ToString());//主窗体传过来的值，通过e.UserState.ToString()来接受
            }
            catch (Exception)
            {
            }
            
        }

        private void FrmProcessBar_Load(object sender, EventArgs e)
        {

        }

        
    }
}
